package homework;

import java.util.Map;
import java.util.stream.Collectors;

public class Work7 {
	public static void main(String[] args) {
		String str1="ppRYYGrrYBR2258";
		String str2="YrR8RrY";
		
		Map<Character, Long> collect = str1.chars().mapToObj(c -> (char) c)
				.collect(Collectors.groupingBy(c->c,Collectors.counting()));
		Map<Character, Long> collect2 = str2.chars().mapToObj(c->(char) c)
				.collect(Collectors.groupingBy(c->c,Collectors.counting()));
		System.out.println(collect);
		System.out.println(collect2);
		boolean allMatch = collect2.entrySet().stream()
		.allMatch(s->collect.containsKey(s.getKey()) && collect.get(s.getKey())>=s.getValue());
		if(allMatch){
			System.out.println("yes,"+(str1.length()-str2.length()));
		}else{
			System.out.println("no");
		}

	}
}
